<?php

  // include base peer class
  require_once 'model/om/BaseWorkorderPeer.php';
  
  // include object class
  include_once 'model/Workorder.php';


/**
 * Skeleton subclass for performing query and update operations on the 'workorder' table.
 *
 * 
 *
 * You should add additional methods to this class to meet the
 * application requirements.  This class will only be generated as
 * long as it does not already exist in the output directory.
 *
 * @package model
 */	
class WorkorderPeer extends BaseWorkorderPeer {

public static function GetWorkorderPager ($page) {
	$pager = new sfPropelPager('Workorder', 20);
	$c = new Criteria();
	$c->AddDescendingOrderByColumn(self::UPDATED_ON);
	
	$pager->setCriteria($c);
	$pager->setPage($page);
	$pager->setPeerMethod('doSelectJoinCompany');
	$pager->init();
	
	return $pager;
}

public static function GetRecentPager ($page) {
	$pager = new sfPropelPager('Workorder', 20);
	$c = new Criteria();
	$c->AddDescendingOrderByColumn(self::UPDATED_ON);
	
	$pager->setCriteria($c);
	$pager->setPage($page);
	$pager->setPeerMethod('doSelectJoinCompany');
	$pager->init();
	
	return $pager;
}

public static function GetMyPager ($page, $user_id) {
	$pager = new sfPropelPager('Workorder', 20);
	$c = new Criteria();
	$c->addDescendingOrderByColumn(self::UPDATED_ON);
	$c->add(self::PM_ID, $user_id);
	
	$pager->setCriteria($c);
	$pager->setPage($page);
	$pager->setPeerMethod('doSelectJoinCompany');
	$pager->init();
	
	return $pager;
}


} // WorkorderPeer
